<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="${package.Mapper}.${table.mapperName}">

  <insert id="inserts" parameterType="List">
    INSERT INTO ${schemaName}${table.name}(
<#list table.fields as field>
      ${field.columnName},
</#list>
      order_number,
      insert_user
    )
    <foreach collection="list" item="item" open="VALUES" separator=",">
      (
<#list table.fields as field>
        ${'#'}{item.${field.propertyName}},
</#list>
      <choose>
        <when test="item.orderNumber == null">
          0,
        </when>
        <otherwise>
          ${'#'}{item.orderNumber},
        </otherwise>
      </choose>
        ${'#'}{item.insertUser}
      )
    </foreach>
  </insert>

</mapper>